package string;

public class SubstringDemo {
    public static void main(String[] args) {
        String str ="www.tedu.cn";
        int start=str.indexOf(".")+1;
        int ends=str.indexOf(".",start);
        String name=str.substring(start,ends);//截取下表4到7的字符串
        System.out.println(name);//tedu
    }
}
